package com.yunyan.controller;

import com.yunyan.req.PageReq;
import com.yunyan.req.SchoolParam;
import com.yunyan.resp.JsonResp;
import com.yunyan.service.SchoolService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/school")
@CrossOrigin(origins = "http://localhost:8081")
public class SchoolController {


    @Resource
    private SchoolService schoolService;

    @GetMapping("/page")
    public JsonResp pageQuery(PageReq pageReq, SchoolParam search){
        return JsonResp.ok(schoolService.pageQuery(pageReq, search));
    }
}
